Skip to content

feat(ui): show markdown images as links unless showImage allows them - #267

Open
xsahil03x wants to merge 3 commits into
mainfrom
fix/markdown-images-as-links
Open

xsahil03x wants to merge 3 commits into
mainfrom
fix/markdown-images-as-links

Conversation

@xsahil03x

Copy link
Copy Markdown
Member

Part of FLU-1375

What

  • StreamMessageText shows a markdown image (![alt](url)) as a link to the image, labelled with its alt text (or its address, shortened past 48 characters), instead of loading it. Tapping it goes through onTapLink like any other link.
  • New showImage (StreamMarkdownImagePredicate) decides which images are shown as images. It receives a StreamMarkdownImage (uri, alt, title) and is only asked about http/https images; other schemes always stay links.
  • imageBuilder now builds only the images showImage allows. Without one, allowed images render as StreamNetworkImage.
  • Gallery: the StreamMessageText showcase has cards for the default (links), an allowed host with the default builder, and an allowed host with a custom imageBuilder. The example image URL, which now returns 403, is replaced.

Verified

  • Widget tests: default link and tap target, URL label and shortening, reference-style images, an image inside a link, imageBuilder not called without showImage, mixed allowed/linked hosts, the values passed to showImage, non-http(s) schemes staying links, and the StreamNetworkImage default.
  • flutter test --exclude-tags golden for stream_core_flutter (781 tests), dart analyze --fatal-infos, dart format, melos run check:barrels.
  • Checked in the gallery on macOS.

🤖 Generated with Claude Code

StreamMessageText renders `![alt](url)` as a link labelled with the alt
text (or the address, shortened) instead of loading it. The new
`showImage` predicate decides which http(s) images are shown as images;
`imageBuilder` builds only those, defaulting to StreamNetworkImage.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@xsahil03x
xsahil03x requested a review from a team as a code owner November 26, 2026 16:35
@github-actions github-actions Bot added the ready Pull request ready to be reviewed label Nov 26, 2026
xsahil03x and others added 2 commits November 26, 2026 17:44
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…round

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready Pull request ready to be reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant